package com.qt.controller;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.security.Principal;

@RestController
@RequestMapping("/user")
public class UserController {
    @RequestMapping("/name")
    public String name(Principal principal) {
        String name = principal.getName();
        return name;
    }

    @RequestMapping("/principal")
    public Principal principal(Principal principal){
        return principal;
    }
}
